package hu.bme.mit.androtext.age.ui.wizard.newfile;

import org.eclipse.core.resources.IFile;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.ui.INewWizard;
import org.eclipse.ui.IWorkbench;

public class NewAndroGuiFileWizard extends Wizard implements INewWizard {

	private IStructuredSelection selection;
    private NewAndroGuiFileWizardPage newFileWizardPage;
	
	@Override
	public void init(IWorkbench workbench, IStructuredSelection selection) {
		setWindowTitle("New AndroGui File");
		this.selection = selection;
	}

	@Override
	public void addPages() {
		newFileWizardPage = new NewAndroGuiFileWizardPage("androguifilepage", selection);
		addPage(newFileWizardPage);
	}
	
	@Override
	public boolean performFinish() {
		IFile file = newFileWizardPage.createNewFile();
        if (file != null)
            return true;
        else
            return false;
	}

}
